{
	template:`
	<a-page-header title="编辑" sub-title="数据表">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="8">
						<a-form-item label="字段" class="index-form-item">
                            <a-tooltip title="只能输入小写字母数字和下划线">
							    <a-input v-model:value="model.name" placeholder="请输入字段"/>
							</a-tooltip>
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="描述" class="index-form-item">
							<a-input v-model:value="model.description" placeholder="请输入描述"/>
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-form-item label="非空" class="index-form-item">
							<a-radio-group :options="dictOptions('api.model.ApiColumn!notnull')" v-model:value="model.notnull" />
						</a-form-item>
					</a-col>
					<a-col :span="24">
						<a-form-item label="类型" class="index-form-item">
							<a-radio-group :options="dictOptions('api.model.ApiColumn!type')" v-model:value="model.type" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='MODEL'" :span="24">
						<a-form-item label="表" class="index-form-item">
							<a-select :options="modelClasses" v-model:value="model.modelClass" placeholder="请选择表" show-search :filter-option="selectFilter" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='TABLE'" :span="24">
						<a-form-item label="表" class="index-form-item">
							<a-select :options="modelTables" v-model:value="model.modelTable.oid" placeholder="请选择表" show-search :filter-option="selectFilter" />
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='STRING'" :span="8">
						<a-form-item label="长度" class="index-form-item">
							<a-input-number v-model:value="model.length" placeholder="请输入长度" style="width:100%;"/>
						</a-form-item>
					</a-col>
					<a-col v-if="model.type=='STRING'" :span="16">
						<a-form-item label="字典" class="index-form-item">
                            <a-tooltip>
                                <template #title>
                                    A:普通字典:填字典类型<br/>
                                    B:选项字典:格式填(值:名称,值:名称)
                                </template>
							    <a-input v-model:value="model.dictType" placeholder="请输入字典属性"/>
                            </a-tooltip>
						</a-form-item>
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
		    model:{modelTable:{oid:""}},
		    modelClasses:[],
		    modelTables:[]
		};
	},
	mounted(){
	    this.model=this.param.model;
	    this.modelClasses=this.param.modelClasses;
	    this.modelTables=this.param.modelTables;
	},
	methods:{
		save:function(){
			this.requestData('action/api/apiColumn/doSave',
				{model:this.model},
				data=>{
					if(data.code==0){
						this.$message.success(data.msg);
						this.back(true);
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		}
	}
}